<!DOCTYPE html>
<html>

	<head>
		<meta charset="UTF-8">
		<title>完工进度计划信息</title>
		<link rel="stylesheet" type="text/css" href="../../css/style.css" />
		<link rel="stylesheet" type="text/css" href="../../css/form.css" />
		<link rel="stylesheet" type="text/css" href="../../css/layui.css"/>
		<link rel="stylesheet" type="text/css" href="../../css/jquery-ui.css" />
		<link rel="stylesheet" href="../../css/jquery.fileupload.css">
		<link rel="stylesheet" type="text/css" href="../../css/technologyFselect.css" />
		<style type="text/css">
			#tablelist tr td label.error {
				left: 54px;
			}
			
			#tablelist tr td {
				height: 28px;
			}
			
			.fileupload {
				width: 100px;
			}
			
			.fileupload img {
				margin-left: 30px;
			}
			/* 工艺管理弹框样式 */
			
			.input_radio2 {
				width: 300px;
				height: 300px;
				text-align: center;
				position: absolute;
				top: 50%;
				left: 50%;
				margin-left: -150px;
				margin-top: -100px;
				background: rgb(245, 245, 245);
				border: 1px solid rgb(200, 200, 200);
				box-shadow: 5px 5px 5px rgb(100, 100, 100);
			}
			
			.input_radio2 p {
				text-align: center;
				height: 30px;
				background: rgb(68, 161, 248);
				line-height: 30px;
				color: white;
				margin-bottom: 25px;
			}
			
			.input_radio2 p {
				text-align: center;
				height: 30px;
				background: rgb(68, 161, 248);
				line-height: 30px;
				color: white;
				margin-bottom: 25px;
			}
			
			.input_radio2 .fs-wrap {
				width: 200px;
			}
			.org_window {
		width: 500px;
		height: 300px;
		text-align: center;
		position: absolute;
		top: 35%;
		left: 40%;
		margin-left: -150px;
		margin-top: -100px;
		background: rgb(245, 245, 245);
		border: 1px solid rgb(200, 200, 200);
		box-shadow: 5px 5px 5px rgb(100, 100, 100);
	}
	
	.org_window p {
		text-align: center;
		height: 30px;
		background: rgb(68, 161, 248);
		line-height: 30px;
		color: white;
		margin-bottom: 25px;
	}
	.td_with {
		width: 243px;
	}
		</style>
	</head>

	<body>
		<!-- 蓝色背景区域 -->
		<div class="wrap">
			<!-- 白色可用区域 -->
			<div class="canuse">
				<!------ 位置 ------>
				<p class="contentText local"><span>位置：生产过程管理 >生产计划管理>完工进度计划信息</span></p>

				<div class="article_list">
					<!------- 内容 ------->
					<div class="content content1" style="width: 99.6%; margin: 0px auto;">
						<input style="display:none;" id="pageFlag" value="addPage">
						<form id="addForm" action="" method="post">
							<input value='${addFlag}' class="" name="addFlag" id="addFlag" style="display:none;" />
							<!-- 用户列表内容区 -->
							<div class="con con_01">
								<!-- 表单信息填写区 -->
								<h4 class="sel_title">
                                <img src="../../img/list/brand1.png" />
                                <span>计划基本信息</span>
                                <span  id="" class="necessary">（带*号为必填项）</span>
                            </h4>
								<div class="info_area">
									<table class="contentText" border="1" cellspacing="0" cellpadding="0" width="98%" style="margin-bottom: 10px;">
										<tbody>
											<tr class="">

												<th class="" width="12.5%">生产批次号：</th>
												<td width="12.5%">
													<label readonly="true" class="contentText">001</label>
												</td>
												<th class="" width="12.5%">计划号:</th>
												<td width="12.5%">
													<label readonly="true" class="contentText">SCJH2019001702XD001</label>
												</td>
												<th class="" width="12.5%">产品代号：</th>
												<td width="12.5%">
													<label readonly="true" class="contentText">702XD</label>
												</td>
												<th class="" width="12.5%">计划数量:</th>
												<td width="12.5%">
													<label readonly="true" class="contentText">5</label>
												</td>
											</tr>
											
											<tr class="">
												
												<th class="">计划开工时间：</th>
												<td>
													<label readonly="true" class="contentText">2020-02-15</label>
												</td>
												<th class="">计划完工时间:</th>
												<td>
													<label readonly="true" class="contentText">2020-02-28</label>
												<th class="">完工数量：</th>
												<td>
													<label readonly="true" class="contentText">3</label>
												</td>
												<th class="">承制班组:</th>
												<td>
													<label readonly="true" class="contentText">七分厂</label>
												</tr>
											<tr class="">
												<th class="">实际开工时间：</th>
												<td>
													<label readonly="true" class="contentText">2020-09-07 08:52:29</label>
												</td>
												<th class="">实际完工时间:</th>
												<td>
													<label readonly="true" class="contentText">2020-09-17 21:37:16</label>
												</td>	
												<th class="">完工进度：</th>
												<td>
													<label readonly="true" class="contentText">60%</label>
												</td>
												<th class="">零部件代号	：</th>
												<td>
													<label readonly="true" class="contentText">0301-01</label>
												</td>
											</tr>
											<tr class="">
												<th class="">工艺编号：</th>
												<td>
													<label readonly="true" class="contentText">工艺20</label>
												</td>
												<th class="">工艺版本:</th>
												<td>
													<label readonly="true" class="contentText">手动版本</label>
												</td>	
												<th class="">随盘票：</th>
												<td>
													<label class="contentText"><a href="querydiskTicket.html">查看</a></label>
												</td>
												<th class="">合格率：</th>
												<td>
													<label readonly="true" class="contentText">85%</label>
												</td>
											
											</tr>
											<tr>
													<th class="">直通率:</th>
												<td>
													<label readonly="true" class="contentText">75%</label>
												</td>
												
											</tr>
										</tbody>
									</table>
								</div>
							</div>
							<!-- 列表展示区 -->
							<div class="table_border">
								<div class="show_list">
									<div class="title_operate">
										<h4 class="sel_title">
                                        <img src="../../img/list/brand1.png" /><span>工序详情信息</span>
                                    </h4>
									</div>
									<div class="list_area">
										<!-- 信息列表区 -->
										<div class="info_area">
											<table id="processTable" class="tablelist" border="1" cellspacing="0" cellpadding="0">
												<thead>
													<tr class="menuText list_head">
														<th class="checkSelectAll"></th>
														<th class="">序号</th>
														<th class="">工序号</th>
														<th class="">工序类型</th>
														<th class="">工序名称</th>
														<th class="">承制人</th>
														<th class="">实际开始时间</th>
														<th class="">实际结束时间</th>
														<th class="">计划数量</th>
														<th class="">完成数量</th>
														<th class="">总工时</th>
														<th class="">单位平均工时</th>
														<th class="">合格率</th>
														<th class="">直通率</th>
														<th class="">工序文件</th>
													</tr>
												</thead>
												<tbody class="tablelist" id="tablelist">
													<tr>
													<td><input type="checkbox" class="input_checkBox" name="" id="" value=""></td>
													<td>1</td>
													<td><a class="cursor " href="productionPlanDetailedProgress.html">YH0001</a></td>
													<td>生产工序</td>
													<td>零部件设备</td>
													<td>admin</td>
													<td>2020-02-15</td>
													<td>2020-02-28</td>
													<td>5</td>
													<td>3</td>
													<td>12h</td>
													<td>1h</td>
													<td>88%</td>
													<td>78%</td>
													<td><a id="productNumberDisplay">查看</a></td>
												</tr>
												<tr>
													<td><input type="checkbox" class="input_checkBox" name="" id="" value=""></td>
													<td>2</td>
													<td><a class="cursor editBlue" href="productionPlanDetailedStartReport.html">YH0002</a></td>
													<td>检验工序</td>
													<td>零件清洗</td>
													<td>admin</td>
													<td>2020-02-15</td>
													<td>2020-02-28</td>
													<td>5</td>
													<td>3</td>
													<td>12h</td>
													<td>1h</td>
													<td>88%</td>
													<td>78%</td>
													<td><a href="#">查看</a></td>
												</tr>
												<tr>
													<td><input type="checkbox" class="input_checkBox" name="" id="" value=""></td>
													<td>3</td>
													<td><a class="cursor editBlue" href="#">YH0003</a></td>
													<td>生产工序</td>
													<td>电脑版预处理</td>
													<td>admin</td>
													<td>2020-02-15</td>
													<td>2020-02-28</td>
													<td>5</td>
													<td>3</td>
													<td>12h</td>
													<td>1h</td>
													<td>88%</td>
													<td>78%</td>
													<td><a href="#">查看</a></td>
												</tr>
												</tbody>
											</table>
										</div>
										<div align="center" class="btn_sumbit">
											<a href="productionPlanManagement.html" class="bgd_white_two img_hand">返回</a>
										</div>
									</div>
								</div>
							</div>
						</form>
					</div>
				</div>
			</div>
			<!-- 等待加载 -->
			<div id="loader" class="loader hidden">
				<div class="loaderContent">
					<img src="../../img/button/loading.gif" />
					<p>页面数据加载中，请您耐心等待......</p>
				</div>
			</div>

			<!-- 上传文件等待 -->
			<div id="upLoader" class="loader hidden">
				<div class="loaderContent">
					<img src="../../img/button/loading.gif" />
					<p>上传文件中，请您耐心等待......</p>
				</div>
			</div>

			<!-- 鼠标悬浮提示框 -->
			<div id="promptDiv" class="mask hidden">
				<div class="input_radio">
					<p>上传附件操作</p>
					<div id="popWindow">
						<button onclick="previewFile();" class="bgd_blue_two img_hand contentText">预览</button>
						<button onclick="downloadFile();" class="bgd_blue_two img_hand contentText">下载</button>
						<button onclick="delFile();" class="bgd_blue_two img_hand contentText">删除</button>
						<button onclick="cancel();" class="bgd_blue_two img_hand contentText">取消</button>
					</div>
				</div>
			</div>

		</div>
		<!--产品编号展示-->
		<div id="productNumberDisplayDiv" class="mask hidden">
							<div class="org_window" style="">
								<p>工序文件信息</p>
								<div class="article_list" style="width: 90%; margin: 0px auto;">
									<!------- 添加内容 ------->
									<div class="content content1">
										<!-- 用户列表内容区 -->
										<div class="con con_01">
											<!-- 表单信息填写区 -->
										<!--	<h4 class="sel_title" style="text-align: left;">
												<img src="../../img/list/brand1.png" /><span>产品编号详情信息</span>
											</h4>-->
											<div class="">
													<sf:form method="post" id="addFrom" modelAttribute="organization">
													<table class="contentText" border="1" cellspacing="0" width="100%" cellpadding="0">
														  <tbody>
				                                    <tr class="menuText list_head">
                                      					<th style="height: 20px;">序号</th>
				                                        <th>工序文件列表</th>
				                                    </tr>
				                                </tbody>
														<tr>
															<td >1</td>
															<td ><a href="#">第一工序.jpg</a></td>
														</tr>
														<tr>
															<td >2</td>
															<td ><a href="#">第二工序.xlsx</a></td>
														</tr>
													</table>
												</sf:form>
												<!-- 保存、重置按钮区 -->
												<div align="center" class="btn_submit" style="margin-top: 20px;">
													<a href="productionPlanCompletionSchedule.html" class="bgd_blue_two img_hand">关闭</a>
													<!--<a href="organizationList.html" class="bgd_white_two img_hand">返回</a>-->
												</div>
											</div>
										</div>
									</div>
								</div>
							</div>
						</div>
		<!-- 点击添加通用工艺的弹框 -->
		<div id="commonTechDiv" class="mask hidden">
			<div class="input_radio2">
				<p>请选择要添加的通用工艺</p>
				<div id="popWindow">
					<input type="hidden" id="productTechnologyInput">
					<select id="productTechnology" multiple='multiple'>
						<option>通用工艺一</option>
						<option>通用工艺二</option>

						<option>通用工艺三</option>

					</select>
				</div>
				<div style="position: absolute;bottom: 10px;left: 75px;">
					<input class="bgd_blue_two img_hand contenText" type="button" value="确定" onclick="addCommonProcess()">
					<input class="bgd_blue_two img_hand contenText" type="button" value="返回" onclick="commonProcessBack()">
				</div>
			</div>
		</div>
		<!-- 版尾  -->
		<div class="ending">Copyright© 2019-2020  磐基技术有限公司</div>
		</div>
	</body>

	<script src="../../js/3rd/jquery-1.9.1.min.js" type="text/javascript" charset="utf-8"></script>
	<script src="../../js/3rd/jquery-ui.js" type="text/javascript"></script>
	<script src="../../js/3rd/jquery.validate.min.js" type="text/javascript"></script>
	<script src="../../js/common/common.js" type="text/javascript" charset="utf-8"></script>
	<script src="../..//js/3rd/jquery.ui.widget.js"></script>
	<script src="../..//js/3rd/jquery.iframe-transport.js"></script>
	<script src="../../js/3rd/jquery.fileupload.js"></script>
	<script src="../../js/baseData/productTeachnologyAdd.js" type="text/javascript"></script>
	<script src="../../js/baseData/uploadFileOperate.js" type="text/javascript"></script>
	<script src="../../js/baseData/technologyFselect.js" type="text/javascript"></script>
	<script type="text/javascript">
		$(function() {

			$("#productTechnology").fSelect();

			window.confirm = function confirm(e, callback) {
				jQuery("body").append('<div id="msg_mask"><div id="msg"><div id="msg_top"><img id="msg_img" src="../../img/button/hint1.png" />提示信息<span class="msg_close" id="msg_close">×</span></div><div id="msg_cont">' + e +
					'</div><div class="msg_close msg_btn" id="msg_cancle">取消</div><div class="msg_close msg_btn" id="msg_sure">是</div><div class="msg_close msg_btn" id="msg_no">否</div></div></div>');
				// 确定
				jQuery("#msg_sure").click(function() {
					jQuery("#msg").remove();
					jQuery("#msg_mask").remove();
					if(callback) {
						callback("Y");
					}
				});

				jQuery("#msg_cancle").click(function() {
					jQuery("#msg").remove();
					jQuery("#msg_mask").remove();
					if(callback) {
						callback("C");
					}
				});

				jQuery("#msg_no").click(function() {
					jQuery("#msg").remove();
					jQuery("#msg_mask").remove();
					if(callback) {
						callback("N");
					}
				});

				jQuery("#msg_close").click(function() {
					jQuery("#msg").remove();
					jQuery("#msg_mask").remove();
				});
			}
		});
	</script>
	<script type="text/javascript">
		/**
		 * 产品编号显示弹框
		 */
		$("#productNumberDisplay").click(function(){
			$("#productNumberDisplayDiv").removeClass("hidden");
		});
		// 添加通用工艺
		function addCommonTechnology() {
			$("#commonTechDiv").removeClass("hidden");
		}

		function addCommonProcess() {
			window.location.href = "productionStartReport.html";
		}

		function commonProcessBack() {			
			window.location.href = "productionStartReport.html";
		}

		var h = document.documentElement.clientHeight;
		$(".wrap").css("height", h);

		// 获取每行 td 的兄弟节点
		$(".info_area td").hover(function() {
			$(this).parent().children().addClass("td_hover");
		}, function() {
			$(this).parent().children().removeClass("td_hover");
		});

		// 文件上传的主流程
		function fileUpload(formObj) {
			var file = formObj.files[0];
			if(file.size > 524288000) {
				alert("最大上传文件不能超过500M");
				return;
			}
			$("#upLoader").show();
			if(file) {
				var formData = new FormData();
				formData.append("processfile", file);
				formData.append("coverFlag", "P");
				var uploadResult = ajaxUploadFile(formData);
				// 根据上传结果状态
				if(uploadResult.uploadStatus == "uploadSuccess") {
					uploadFileResultDeal(formObj, uploadResult);
				} else if(uploadResult.uploadStatus == "fileExist") {
					//文件名重复，弹框
					alert("文件名重复请修改文件名后上传！");
					/* window.confirm("文件名重复，是否覆盖?",function(result){
						if("C" != result){
							if("Y" == result){
								formData.set("coverFlag", "Y");
							}else if("N" == result){
								formData.set("coverFlag", "N");
							}
							// 再次上传文件
							var uploadResult = ajaxUploadFile(formData);
							if(uploadResult.uploadStatus == "uploadSuccess"){
								if("Y" != formData.get("coverFlag")){
									
									uploadFileResultDeal(formObj, uploadResult);
								}
							}else{
								alert("文件上传失败！");
							}
						}
					}); */
				} else {
					alert("文件上传失败！");
				}

			}
		}

		// 上传文件
		function ajaxUploadFile(sendData) {
			var uploadResult;
			$.ajax({
				url: "/productTechnology/uploadFile",
				dataType: "json",
				type: "POST",
				data: sendData,
				async: false,
				cache: false,
				processData: false,
				contentType: false,
				success: function(resultData) {
					uploadResult = resultData;
				},
				error: function(resultData) {
					uploadResult = "error";
				},
				complete: function(result) {
					$("#upLoader").hide();
				}
			});
			return uploadResult;
		}

		// 上传成功后显示对应图标
		function uploadFileResultDeal(targetEle, resultData) {

			// 显示图片
			var saveFileId = targetEle.getAttribute("id").replace("uploadfile", "saveFileName");
			var oriFileId = targetEle.getAttribute("id").replace("uploadfile", "oriFileName");
			var saveFileEle = $("#" + saveFileId)[0];
			var oriFileEle = $("#" + oriFileId)[0];
			var oldFileStr = saveFileEle.value;
			if("" != oldFileStr && null != oldFileStr) {
				saveFileEle.value = oldFileStr + "," + resultData.saveFileName;
				oriFileEle.value = oriFileEle.value + "," + resultData.oriFileName;
			} else {
				saveFileEle.value = resultData.saveFileName;
				oriFileEle.value = resultData.oriFileName;
			}
			// class 的第一个数字表示权限文件，第二个表示文件位置是在临时文件夹还是saveFiles
			var imgHtml = "<div onclick = 'operateFile(this)' class = '0 tempUpFiles'><img src='/css/img/fileStandard.png'><span>" + resultData.oriFileName + "</span></div>";
			$(saveFileEle.parentNode).append(imgHtml);

		}
	</script>

</html>